import os
from eyeD3 import *
from mp3clone import getfilelist
#TODO: options
#TODO: walk thru files
#TODO: implement tag2.getImages()[1].getDefaultFileName()
#TODO: implement frames saving
#TODO: GUI for tag editor.


def is_clone(fname1,fname2):
    return os.path.split(fname1)[1]==os.path.split(fname2)[1]
                                               

src_list=getfilelist('m:/kw','.mp3')
dst_list=getfilelist('m:/kwtags','.mp3')

src_base='m:\\'
dst_base='m:\\'

for src_file in src_list:     
    dst_file=dst_list[dst_list.index(dst_base+'\\'+src_file.split(src_base)[1])]        
    src_tag= eyeD3.Tag()    
    src_tag.link(src_file)    
    dst_tag= eyeD3.Tag()    
    dst_tag.link(dst_file)
    dst_tag.frames=src_tag.frames    
    print dst_file
    dst_tag.update(eyeD3.ID3_V2_3)

    
    
#    print src_file, dst_file

#    print "%s: %s : %s"% (src_tag.getTitle(), src_tag.getArtist(),dst_tag.getArtist())

#tag.link('e:/tmp/test/test.mp3',eyeD3.ID3_V2)
#tag1.link('e:/tmp/test/test1.mp3',eyeD3.ID3_V2)
